<template>
	<view class="content">
		<view class="alertBox"><u-alert title="请输入或粘贴对应的账户信息,回复您的账户" class="alerttxt" type = "warning"></u-alert></view>
		<view class="tab"><u-subsection :list="tabList" :current="current" @change='subsectionChange' activeColor='#000'></u-subsection></view>
		<view class="tabbox">
			<view class="tabbox0" v-if="current == 0"><text>粘贴</text><u--textarea class="textarea" v-model="tabObject.textareaVal" placeholder="请粘贴您的公钥以-----BEGIN PUBLIC KEY----开始,以-----ENDPUBLICKEY-----结束" border="none"></u--textarea></view>
			<view class="tabbox1" v-if="current == 1"><text>粘贴</text><u--textarea class="textarea" v-model="tabObject.textareaVal" placeholder="请粘贴您的私钥以-----BEGIN PRIVATE KEY---开始,以-----ENDPRIVATEKEY-----结束" border="none"></u--textarea></view>
			<view class="tabbox2" v-if="current == 2"><text>粘贴</text><u--textarea class="textarea" v-model="tabObject.textareaVal" placeholder="请粘贴您的钱包地址.长度为34位" border="none"></u--textarea></textarea></view>
		</view>
		<view class="formbox">
			<u--form labelPosition="left" :model="tabObject" :rules="rules" ref="uForm" class="walletform" >
				<u-form-item label="输入密码" labelWidth="80" prop="tabObject.password">
					<u--input v-model="tabObject.password" type='password' placeholder="用于登录和支付确认" border="none"></u--input>
				</u-form-item>
				<u-form-item label="确认密码" labelWidth="80" prop="tabObject.okpassword">
					<u--input v-model="tabObject.okpassword" type='password' placeholder="请再次输入密码" border="none"></u--input>
				</u-form-item>
			</u--form>
		</view>
		<view>
			<u-button type="primary" class="login_btnd" :plain="true" text="一键粘贴" @click="relywalletClick"></u-button>
			<u-button type="primary" class="login_btn" text="开始接单" @click="relywalletClick"></u-button>
		</view>
		<botLine />
	</view>
</template>

<script>
	import botLine from '../../components/botLine.vue'
	export default {
		components:{
			botLine
		},
		data() {
			return {
				tabList : ['公钥', '私钥', '地址'],
				current : 0,
				tabObject:{
					textareaVal:'',
					password:'',
					okpassword:'',
				},
				rules:[]
			}
		},
		onLoad() {
			let cookies = JSON.parse(localStorage.getItem('cookies'))
			this.addressinfoDataFN(cookies && cookies[0].uid)
		},
		methods: {
			subsectionChange(v){
				console.log(v)
				this.current = v
			},
			relywalletClick(){
				uni.switchTab({
					url:`/pages/tabbar/tradingFloor/index`
				});
			},
			// 接口
			addressinfoDataFN(uid){
				uni.request({
					url:'/index/api/start_mate',
					method:'post',
					data:{uid:uid},
					success:res=>{
						// this.listData = res.data.info;
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
.content{padding:0 20rpx ;
	height: 100vh;background-color: #f1f5f8;
	.alertBox{padding-top:20rpx;}
	.alerttxt{border: #f9ae3d solid 1px;
		span{font-weight: 100;}
	}
	.tab{padding-top:20rpx;}
	.tabbox{margin-top:25rpx;background-color: #fff;height: 450rpx;padding:20rpx;box-sizing: border-box;position: relative;
		.textarea{background-color: #f6f7fb;width:100%;height: 410rpx;padding: 20rpx;box-sizing: border-box;}
		text{
			position: absolute;right:30rpx;bottom:30rpx;z-index: 89;font-size: 16rpx;color:#479aef;cursor: pointer;
		}
	}
	.login_btn{background-color: $btnColor;border: $btnColor solid 1px;margin:20rpx auto 0;width:95%;}
	.login_btnd{border: $btnColor solid 1px;width:95%;color:$btnColor;margin:50rpx auto 0;}
	.formbox{
		padding: 0 10rpx;
		.walletform{margin:70rpx auto 0;
			.u-form-item{
				background-color: #fff;padding:0 20rpx;margin-top: 10rpx;
			}
		}
	}
	
}
</style>
